package com.woohua.thread.cyclicbarrier;

import java.util.concurrent.TimeUnit;

/***
 * @title AssembleCar
 * @description
 * @author woo hua
 * @version 1.0.0
 * @create 2023/3/17 14:56
 **/
public class AssembleCar implements Runnable{
    @Override
    public void run() {

        try {
            System.out.println("Starting assemble car...");

            // 模拟组装汽车
            long millis = ((int) (1 + Math.random() * (5-1+1))) * 1000;
            TimeUnit.MILLISECONDS.sleep(millis);
            System.out.println("Making assemble car is finished");

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
